package com.rightsidetech.system.mapper;

import com.rightsidetech.system.dtos.request.SysResourceRoleResp;
import com.rightsidetech.system.dtos.request.SysResourceUpdateReq;
import com.rightsidetech.system.entity.SysResource;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.Mapping;

import java.util.Date;
import java.util.List;

public interface SysResourceMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysResource record);

    int insertSelective(SysResource record);

    SysResource selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysResource record);

    int updateByPrimaryKey(SysResource record);

    int insertResourceList( @Param("list")List<SysResourceUpdateReq> list, @Param("createdAt") Date createdAt);

    List<SysResource> selectByParentId(@Param("parentId") Long parentId);

    List<SysResource> selectRoleResourceList(@Param("roleId")Long roleId) throws Exception;

    List<SysResourceRoleResp> selectAllResource() throws Exception;

    List<Long> selectAllId();

    Long selevtByUrl(@Param("requestURI") String requestURI, @Param("menuUrl") String menuUrl);

    SysResource selectByNameAndPathAndUrl(@Param("name") String name,@Param("path") String path,@Param("url") String url);

    int updateIsDel(Long id);
}